// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "InputActionValue.h"
#include "PaperZDCharacter.h"

#include "PlatformCharacterBase.generated.h"

class UInputMappingContext;
class UInputAction;


/** 平台跳跃角色基类
 * 
 */
UCLASS()
class TOWERCLIMBER_API APlatformCharacterBase : public APaperZDCharacter
{
	GENERATED_BODY()

public:
	// Sets default values for this character's properties
	APlatformCharacterBase();

protected:
	// Called when the game starts or when spawned
	virtual void BeginPlay() override;

public:
	// Called every frame
	virtual void Tick(float DeltaTime) override;

	// Called to bind functionality to input
	virtual void SetupPlayerInputComponent(class UInputComponent* PlayerInputComponent) override;

	// 解除绑定输入
	UFUNCTION(BlueprintCallable, Category="输入")
	void UnBindingInput();

	virtual void PossessedBy(AController* NewController) override;

	// 默认的映射
	UPROPERTY(EditDefaultsOnly, Category="默认")
	UInputMappingContext* MappingContext = nullptr;

	// 跳跃动作
	UPROPERTY(EditDefaultsOnly, Category="默认")
	UInputAction* JumpAction = nullptr;

	// 攻击动作
	UPROPERTY(EditDefaultsOnly, Category="默认")
	UInputAction* AttackAction = nullptr;

	// 跳跃按下
	UFUNCTION(BlueprintImplementableEvent)
	void JumpPressed();

	// 跳跃松开
	UFUNCTION(BlueprintImplementableEvent)
	void JumpReleased();

	// 攻击按下
	UFUNCTION(BlueprintImplementableEvent)
	void AttackPressed();
	// 攻击松开
	UFUNCTION(BlueprintImplementableEvent)
	void AttackReleased();

	// 移动动作
	UPROPERTY(EditDefaultsOnly, Category="默认")
	UInputAction* MoveAction = nullptr;

	/**
	 * @brief		运动输入
	 * @param Value	绑定的动作
	 */
	UFUNCTION(BlueprintImplementableEvent)
	void Move(const FInputActionValue& Value);

	/**
	 * @brief		运动输入结束
	 * @param Value 绑定的动作
	 */
	UFUNCTION(BlueprintImplementableEvent)
	void MoveCompleted(const FInputActionValue& Value);
};
